<?php
/** Copyright 2014 TinPhp Systems, Inc.
 * @author zhangxilian 2013-8-15
 */
if (!defined('IN_TINPHP')) {
    exit('Access Denied');
}

require_once('indexApp.php');
require_once(TIN_APP_PATH . 'include/webservice/PHYClient.php');

class DemoserviceController extends IndexAppController {

    public function __construct() {
        parent::__construct();
    }
    
    public function phyCall($model, $action, $data){
    	    	
    }

    public function actionDefault() {
    	   
    }
    
    public function actionGetapi(){
    	T :: $tplFile = 'public/empty';
    	$data["type"] = $_REQUEST['restype'];	    
	    try{ 
    		$soap = new PHYClient($_REQUEST['svname'], TIN_PHY_USERNAME, TIN_PHY_PASSWORD, $_REQUEST['apiurl']);    	      
	        $result = $soap->__call($_REQUEST['actname'], array($data));	        
    	}catch(Exception $e){
    		$result = 'Error:'.$e->getMessage();
    	}
    	echo $result;
    }
    
}
?>
